package queue;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author Xu,
 * @data 2020/12/21，
 * @time 20:39
 */
public class Queue1 {
    private BlockingQueue blockingQueue = new LinkedBlockingQueue(1000); ;

    public Queue1(){

    }

    public void getPut(long a){
        try {
            blockingQueue.put(a);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public long getTake(){
        long a = 0;
        try {
            a = (long)blockingQueue.take();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return a;
    }



    public BlockingQueue getBlockingQueue() {
        return blockingQueue;
    }
}
